-----------------------------------------------------------------------------------------------------------------------------------------------------
Understanding the Docker Hub

ubuntu@ip-172-31-21-44:~$ sudo docker login
-----------------------------------------------------------------------------------------------------------------------------------------------------
Pushing images to the Docker Hub

$ sudo docker run -i --name="containerforhub" -t ubuntu /bin/bash

root@bd7cc5df6d96:/# mkdir mynewdir

root@bd7cc5df6d96:/# cd mynewdir

root@bd7cc5df6d96:/mynewdir# echo 'this is my new container to make image and then push to hub' >mynewfile

root@bd7cc5df6d96:/mynewdir# cat mynewfile
This is my new container to make image and then push to hub

root@bd7cc5df6d96:/mynewdir#

$ sudo docker commit -m="NewImage" containerforhub vinoddandy/imageforhub

$ sudo docker push vinoddandy/imageforhub

$ sudo docker stop containerforhub
$ sudo docker rm containerforhub
$

$ sudo docker rmi vinoddandy/imageforhub

$ sudo docker run -i --name="newcontainerforhub" -t vinoddandy/imageforhub /bin/bash

root@9bd40f1b5585:/# cat /mynewdir/mynewfile
This is my new container to make image and then push to hub

$ sudo docker build -t="vinoddandy/dockerfileimageforhub" .

$ sudo docker run -i --name="dockerfilecontainerforhub" -t vinoddandy/dockerfileimageforhub

root@d3130f21a408:/# cat /mynewdir/mynewfile
this is my new container to make image and then push to hub

$ sudo docker login

$ sudo docker push vinoddandy/dockerfileimageforhub
-----------------------------------------------------------------------------------------------------------------------------------------------------
Private repositories on the Docker Hub

$ sudo docker run -p 5000:5000 -d registry

sudo docker tag 224affbf9a65 localhost:5000/vinoddandy/dockerfileimageforhub

$ sudo docker push localhost:5000/vinoddandy/dockerfile
-----------------------------------------------------------------------------------------------------------------------------------------------------
The REST APIs for the Docker Hub

$ curl --raw -L --user vinoddandy:password https://index.docker.io/v1/users

$ curl --raw -L -X POST --post301 -H "Accept:application/json" -H "Content-Type: application/json" --data-ascii '{"email":"singh_vinod@yahoo.com", "password": "password", "username":"singhvinod494" }' https://index.docker.io/v1/users
-----------------------------------------------------------------------------------------------------------------------------------------------------

